import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: "/main",
  },
  {
    path: "/main",
    name: "main",
    component: () => import("@/views/main.vue"),
    children: [
      {
        path: "/dashboard",
        name: "dashboard",
        component: () => import("@/views/dashboard/Dashboard.vue"),
      },
      {
        path: "/users",
        name: "users",
        component: () => import("@/views/users/Users.vue"),
      },
      {
        path: "/dishes",
        name: "dishes",
        component: () => import("@/views/dishes/Dishes.vue"),
      },
      {
        path: "/members",
        name: "members",
        component: () => import("@/views/members/Members.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
